<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
  <script>
    function Parent1() {
      this.name = 'parent1';
    }
    Parent1.prototype.getName = function () {
      return this.name;
    };
    function Child1() {
      Parent1.call(this);
      this.type = 'child1';
    }
    let child = new Child1();
    console.log(child);
    console.log(child.getName());
  </script>
</html>
